package org.jfk.core.controller;

public class IndexController extends BaseController {
	
	public void m(){
		super.render("/index_m.jsp");
	}
	
	public void index(){
	}
	
	/*
	public void index(){
		redirect("/login");
	}
		
	public void main(){
		Subject subject = SecurityUtils.getSubject();
		boolean rememberMe = subject.isRemembered();
		String loginName = (String)subject.getPrincipal();
		
		User user = User.dao.findByLoginName(loginName);
//		Menu root = Menu.dao.loadByRoot();
//		super.setAttr("root", root);
		super.getSession().setAttribute("currUser", user);
		super.setAttr("currUser", user);
		super.renderJsp("/index.jsp");
	}
	
	public void login(){

	}
	
	public void logout(){
		Subject user = SecurityUtils.getSubject();
		if (user != null){
			user.logout();
		}
		super.redirect("/login");
	}
	
	public void nologin(){
		
	}
	
	public void doLogin(){
        String username = getPara("loginName");
        String password = getPara("password");
        String remember_me = super.getPara("remember_me");
        try{
            UsernamePasswordToken token = new UsernamePasswordToken(username, password);

            boolean rememberMe = remember_me==null?false:true; 
            token.setRememberMe(rememberMe);

            Subject user = SecurityUtils.getSubject();
            user.login(token);
            
        }catch (UnknownAccountException uae) {
        	//uae.printStackTrace();
        	super.setAttr("err_msg", uae.getMessage());
        	super.render("/login.jsp");
            return;
        }catch (IncorrectCredentialsException   ice) {
        	//ice.printStackTrace();
        	super.setAttr("err_msg", I18nUtil.getValueByKey("admin.login.error.password_err"));
        	super.render("/login.jsp");
            return;
        }catch (LockedAccountException  lae) {
        	//lae.printStackTrace();
        	super.setAttr("err_msg", I18nUtil.getValueByKey("admin.login.error.locked_user"));
        	super.render("/login.jsp");
            return;
        }catch (ExcessiveAttemptsException  eae) {
        	//eae.printStackTrace();
        	super.setAttr("err_msg", I18nUtil.getValueByKey("admin.login.error.too_more_try"));
        	super.render("/login.jsp");
            return;
        }catch (AuthenticationException e) {
        	//e.printStackTrace();
        	super.setAttr("err_msg", e.getMessage());
        	super.render("/login.jsp");
            return;
        }
        //登录成功
        redirect("/main");			
	}
	
	public void noperms(){
		
	}
	*/
}
